#include<stdio.h>
#include<string.h>
int main()
{
  int M;
  scanf("%d",&M);
  for(int i=0;i<M;i++)
  {
  	char a[10001],b[10001];
  	scanf("%s %s",a,b);
  	int len1=strlen(a);
    int len2=strlen(b);
    int maxlen=(len1>len2)?len1:len2;
    int result[maxlen+1];
    int carry=0;
    int k=0;
    int ia=len1-1;
    int ib=len2-1;
    while(ia>=0||ib>=0||carry>0)
    {
    	int digita=(ia>=0)?(a[ia--]-'0'):0;
    	int digitb=(ib>=0)?(b[ib--]-'0'):0;
    	int sum=digita+digitb+carry;
    	result[k++]=sum%10;
    	carry=sum/10;
	}
	for(int j=k-1;j>=0;j--)
	{
		printf("%d",result[j]);
  }
  printf("\n");
}
return 0;
}
